﻿using System;
using System.Text;
using System.Drawing;
using System.Threading.Tasks;

namespace WxLib.Core.RequestHandlers
{
    /// <summary>
    /// 从URI请求图片的接口
    /// </summary>
    public interface IImageRequestHandler
    {
        /// <summary>
        ///  请求并返回图片数据
        /// </summary>
        /// <param name="uri">请求地址</param>
        /// <returns>图片数据</returns>
        Task<byte[]> RequestImageDataAsync(Uri uri);

        /// <summary>
        ///  请求图片并将其保存到文件
        /// </summary>
        /// <param name="uri">请求地址</param>
        /// <param name="file">图片保存到本地的路径</param>
        /// <returns>异步任务</returns>
        Task RequestImageAsync(Uri uri, string file);

        /// <summary>
        /// 请求并返回图片数据
        /// </summary>
        /// <param name="uri">请求地址</param>
        /// <param name="postString"></param>
        /// <returns></returns>
        Task<byte[]> PostRequestImageDataAsync(Uri uri, string postString);
    }
}